import request from '@/utils/request'

export const getList = (params) => {
  return request.get('parking/rule/list', params)
}

// 删除
export const delList = (id) => {
  return request.delete(`/parking/rule/${id}`)
}

// 添加
export const addSubmitApi = ({
  ruleNumber,
  ruleName,
  freeDuration,
  chargeCeiling,
  chargeType,
  durationTime,
  durationPrice,
  durationType,
  turnPrice,
  partitionFrameTime,
  partitionFramePrice,
  partitionIncreaseTime,
  partitionIncreasePrice
}) => {
  return request.post('/parking/rule', {
    ruleNumber,
    ruleName,
    freeDuration,
    chargeCeiling,
    chargeType,
    durationTime,
    durationPrice,
    durationType,
    turnPrice,
    partitionFrameTime,
    partitionFramePrice,
    partitionIncreaseTime,
    partitionIncreasePrice
  })
}
// 编辑
export const editSubmitApi = ({
  id,
  ruleNumber,
  ruleName,
  freeDuration,
  chargeCeiling,
  chargeType,
  durationTime,
  durationPrice,
  durationType,
  turnPrice,
  partitionFrameTime,
  partitionFramePrice,
  partitionIncreaseTime,
  partitionIncreasePrice
}) => {
  return request.put('/parking/rule', {
    id,
    ruleNumber,
    ruleName,
    freeDuration,
    chargeCeiling,
    chargeType,
    durationTime,
    durationPrice,
    durationType,
    turnPrice,
    partitionFrameTime,
    partitionFramePrice,
    partitionIncreaseTime,
    partitionIncreasePrice
  })
}

// 编辑回显
// 删除
export const editListApi = (id) => {
  return request.get(`/parking/rule/${id}`)
}

